package cn.easytogo.service.impl;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.easytogo.service.IBaseDAO;
import cn.easytogo.service.IBaseService;

public class BaseService implements IBaseService {
	private IBaseDAO baseDAO;
	
	public void setBaseDAO(IBaseDAO baseDAO) {
		this.baseDAO = baseDAO;
	}
	
	public IBaseDAO getBaseDAO() {
		if(baseDAO==null){
			ApplicationContext ac= new ClassPathXmlApplicationContext("spring.xml");
			baseDAO = (IBaseDAO) ac.getBean("baseDAO");
		}
		return baseDAO;
	}
	

}
